<?php

/** @var \Laravel\Lumen\Routing\Router $router */

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->group(['prefix' => 'admin','namespace' => 'Admin'], function () use ($router) {
    $router->post('login', 'AuthController@login');
    $router->get('refreshToken', 'AuthController@refreshToken');
});

$router->group(['prefix' => 'admin','middleware' => 'auth:admin','namespace' => 'Admin'], function () use ($router) {

    $router->get('userAuth', 'UserController@userAuth');
    $router->get('logout', 'AuthController@logout');
    $router->get('menuList', 'MenuController@menuList');
    $router->get('districtTree', 'CommonController@districtTree');
    $router->post('upload', 'CommonController@upload');
    $router->post('fileAdd', 'CommonController@fileAdd');
    $router->get('getParams', 'CommonController@getParams');

    $router->post('getUserList', 'UserController@getUserList');
    $router->post('userList', 'UserController@userList');
    $router->post('userAdd', 'UserController@userAdd');
    $router->post('userDel', 'UserController@userDel');

    $router->post('getRoleList', 'RoleController@getRoleList');
    $router->post('roleList', 'RoleController@roleList');
    $router->post('roleAdd', 'RoleController@roleAdd');
    $router->post('roleDel', 'RoleController@roleDel');
    $router->post('getPermission', 'RoleController@getPermission');

});



